package com.endpoint.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Project: endpoint
 * @Name: EndPointElasticSearchConfig
 * @Author: Jack_Li
 * @Date: 2024/7/4 20:26
 */

@Configuration
public class EndPointElasticSearchConfig {

    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("192.168.33.128", 9200, "http")));
        //目前只使用单节点 只有一个
        return client;
    }

}
